\hypertarget{class_box}{
\section{\-Box \-Class \-Reference}
\label{class_box}\index{\-Box@{\-Box}}
}


\hyperlink{class_box}{\-Box} class.  




{\ttfamily \#include $<$box.\-h$>$}

\-Inheritance diagram for \-Box\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{class_box}
\end{center}
\end{figure}
\subsection*{\-Public \-Member \-Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_box_aca78d7db44972bfa78d46b7bbc8796f6}{
\hyperlink{class_box_aca78d7db44972bfa78d46b7bbc8796f6}{\-Box} ()}
\label{class_box_aca78d7db44972bfa78d46b7bbc8796f6}

\begin{DoxyCompactList}\small\item\em \-Creates a generic box (empty). \end{DoxyCompactList}\item 
\hypertarget{class_box_ab4a2a18916c428de651b22cdf280bf3e}{
{\bfseries \-Box} (const \hyperlink{class_vector}{\-Vector} \&)}
\label{class_box_ab4a2a18916c428de651b22cdf280bf3e}

\item 
\hypertarget{class_box_a1f9d59659dc2304ed62088464f48c4da}{
{\bfseries \-Box} (const \hyperlink{class_vector}{\-Vector} \&, const \hyperlink{class_vector}{\-Vector} \&, const \hyperlink{class_vector}{\-Vector} \&, const \hyperlink{class_vector}{\-Vector} \&, int)}
\label{class_box_a1f9d59659dc2304ed62088464f48c4da}

\item 
\hypertarget{class_box_aa151dd75dfbe1632979853fe157322ea}{
{\bfseries \-Box} (const \hyperlink{class_vector}{\-Vector} \&, const double \&)}
\label{class_box_aa151dd75dfbe1632979853fe157322ea}

\item 
\hypertarget{class_box_a85ed08338073ace8d12833af0c861efb}{
{\bfseries \-Box} (\hyperlink{class_vector}{\-Vector} $\ast$, int)}
\label{class_box_a85ed08338073ace8d12833af0c861efb}

\item 
\hypertarget{class_box_a0a7c6f0b0405db01518bb3201b00c9a2}{
{\bfseries \-Box} (const \hyperlink{class_box}{\-Box} \&, const \hyperlink{class_box}{\-Box} \&)}
\label{class_box_a0a7c6f0b0405db01518bb3201b00c9a2}

\item 
\hypertarget{class_box_a6a5e09398e85d602a046b429062fb9c2}{
\hyperlink{class_box_a6a5e09398e85d602a046b429062fb9c2}{$\sim$\-Box} ()}
\label{class_box_a6a5e09398e85d602a046b429062fb9c2}

\begin{DoxyCompactList}\small\item\em \-Destroy a box, empty. \end{DoxyCompactList}\item 
\hypertarget{class_box_ad41f9a6efac5787613914b12e4c3d11d}{
\hyperlink{class_vector}{\-Vector} \& \hyperlink{class_box_ad41f9a6efac5787613914b12e4c3d11d}{operator\mbox{[}$\,$\mbox{]}} (int)}
\label{class_box_ad41f9a6efac5787613914b12e4c3d11d}

\begin{DoxyCompactList}\small\item\em \-Returns either end vertex of the box. \end{DoxyCompactList}\item 
\hypertarget{class_box_ae638073ba0eb5b6cb7a1f9de3b9a7bd8}{
\hyperlink{class_vector}{\-Vector} \hyperlink{class_box_ae638073ba0eb5b6cb7a1f9de3b9a7bd8}{operator\mbox{[}$\,$\mbox{]}} (int) const }
\label{class_box_ae638073ba0eb5b6cb7a1f9de3b9a7bd8}

\begin{DoxyCompactList}\small\item\em \-Overloaded. \end{DoxyCompactList}\item 
\hypertarget{class_box_a44e2805cb2a7acaaa3937522fae56d23}{
\hyperlink{class_vector}{\-Vector} \hyperlink{class_box_a44e2805cb2a7acaaa3937522fae56d23}{\-Center} () const }
\label{class_box_a44e2805cb2a7acaaa3937522fae56d23}

\begin{DoxyCompactList}\small\item\em \-Returns the center of the box. \end{DoxyCompactList}\item 
\hypertarget{class_box_a3e077400dd38d177c39bcc711788eed9}{
\hyperlink{class_vector}{\-Vector} \hyperlink{class_box_a3e077400dd38d177c39bcc711788eed9}{\-Diagonal} () const }
\label{class_box_a3e077400dd38d177c39bcc711788eed9}

\begin{DoxyCompactList}\small\item\em \-Returns the half diagonal of the box. \end{DoxyCompactList}\item 
\hypertarget{class_box_a44dd9300bf9713c9190c3a1e69ef5728}{
double \hyperlink{class_box_a44dd9300bf9713c9190c3a1e69ef5728}{\-Radius} () const }
\label{class_box_a44dd9300bf9713c9190c3a1e69ef5728}

\begin{DoxyCompactList}\small\item\em \-Returns the radius of the box, i.\-e. the length of the half diagonal of the box. \end{DoxyCompactList}\item 
\hypertarget{class_box_a35f5775304c754981b8a38d141737880}{
\hyperlink{class_vector}{\-Vector} \hyperlink{class_box_a35f5775304c754981b8a38d141737880}{\-Vertex} (int) const }
\label{class_box_a35f5775304c754981b8a38d141737880}

\begin{DoxyCompactList}\small\item\em \-Returns the k$^{\mbox{th}}$  vertex of the box. \end{DoxyCompactList}\item 
\hypertarget{class_box_a913a6b1487999917a85d87b49b3c1c52}{
double \hyperlink{class_box_a913a6b1487999917a85d87b49b3c1c52}{\-R} (const \hyperlink{class_vector}{\-Vector} \&) const }
\label{class_box_a913a6b1487999917a85d87b49b3c1c52}

\begin{DoxyCompactList}\small\item\em \-Computes the minimum distance between the box and a point in space. \end{DoxyCompactList}\item 
\hypertarget{class_box_a80db61cd35cae3122fe658ac079495ee}{
\hyperlink{class_vector}{\-Vector} \hyperlink{class_box_a80db61cd35cae3122fe658ac079495ee}{\-Normal} (const \hyperlink{class_vector}{\-Vector} \&) const }
\label{class_box_a80db61cd35cae3122fe658ac079495ee}

\begin{DoxyCompactList}\small\item\em \-Computes the normal vector between a point and a box. \end{DoxyCompactList}\item 
int \hyperlink{class_box_a6ac204afbbdc851645f33df16104292a}{\-Intersect} (const \hyperlink{class_ray}{\-Ray} \&, \hyperlink{class_intersection}{\-Intersection} \&)
\begin{DoxyCompactList}\small\item\em \-Intersecting function. \end{DoxyCompactList}\item 
int \hyperlink{class_box_a53e6a5db3bcc420700f88e6759da805d}{\-Intersect} (const \hyperlink{class_ray}{\-Ray} \&, \hyperlink{class_intersection}{\-Intersection} \&, \hyperlink{class_intersection}{\-Intersection} \&)
\begin{DoxyCompactList}\small\item\em \-Intersecting function. \end{DoxyCompactList}\item 
int \hyperlink{class_box_a13633b69e0fa7b8e6ca35c5d0fc65a8a}{\-Intersect} (const \hyperlink{class_ray}{\-Ray} \&, double \&, \hyperlink{class_vector}{\-Vector} \&) const 
\begin{DoxyCompactList}\small\item\em \-Intersecting function. \end{DoxyCompactList}\item 
\hypertarget{class_box_ac5702737ae3929edb195e49d48abe25d}{
int {\bfseries \-Intersect} (const \hyperlink{class_box}{\-Box} \&) const }
\label{class_box_ac5702737ae3929edb195e49d48abe25d}

\item 
int \hyperlink{class_box_abc15073158a80e02f4b1fb32b50e1eb6}{\-Inside} (const \hyperlink{class_box}{\-Box} \&) const 
\begin{DoxyCompactList}\small\item\em \-Containing function. \end{DoxyCompactList}\item 
int \hyperlink{class_box_aa3a80d26840216d02e1096e28333d65b}{\-Inside} (const \hyperlink{class_vector}{\-Vector} \&) const 
\begin{DoxyCompactList}\small\item\em \-Containing function. \end{DoxyCompactList}\item 
int \hyperlink{class_box_afb71788385a4f8ff91c6d8385972dde4}{\-P\-M\-C} (const \hyperlink{class_vector}{\-Vector} \&)
\begin{DoxyCompactList}\small\item\em \-Containing function. \end{DoxyCompactList}\item 
\hypertarget{class_box_ae6092debba95840365b79a02f60d245c}{
double \hyperlink{class_box_ae6092debba95840365b79a02f60d245c}{\-Volume} () const }
\label{class_box_ae6092debba95840365b79a02f60d245c}

\begin{DoxyCompactList}\small\item\em \-Compute the volume of a box. \end{DoxyCompactList}\item 
\hypertarget{class_box_a8e0a710afacb0bdeb3f751b40ab575b2}{
double \hyperlink{class_box_a8e0a710afacb0bdeb3f751b40ab575b2}{\-Area} () const }
\label{class_box_a8e0a710afacb0bdeb3f751b40ab575b2}

\begin{DoxyCompactList}\small\item\em \-Compute the surface area of a box. \end{DoxyCompactList}\item 
\hypertarget{class_box_a7bde7216a8ec3c840bdfd171f6c9b170}{
\hyperlink{class_vector}{\-Vector} {\bfseries get\-Position} ()}
\label{class_box_a7bde7216a8ec3c840bdfd171f6c9b170}

\end{DoxyCompactItemize}
\subsection*{\-Static \-Public \-Attributes}
\begin{DoxyCompactItemize}
\item 
static const double \hyperlink{class_box_ab038c94f04821a9ab0e0313819e5187c}{epsilon}
\end{DoxyCompactItemize}
\subsection*{\-Protected \-Attributes}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_vector}{\-Vector} \hyperlink{class_box_af9c25486a750badb5e746ba616e44bce}{a}
\item 
\hyperlink{class_vector}{\-Vector} \hyperlink{class_box_a9ba6812e3bc99ab5faf29f44550b57f5}{b}
\end{DoxyCompactItemize}


\subsection{\-Detailed \-Description}
\hyperlink{class_box}{\-Box} class. 

\hyperlink{class_box}{\-Box} is a primitive of the \-C\-S\-G 

\subsection{\-Member \-Function \-Documentation}
\hypertarget{class_box_abc15073158a80e02f4b1fb32b50e1eb6}{
\index{\-Box@{\-Box}!\-Inside@{\-Inside}}
\index{\-Inside@{\-Inside}!Box@{\-Box}}
\subsubsection[{\-Inside}]{\setlength{\rightskip}{0pt plus 5cm}int \-Box\-::\-Inside (
\begin{DoxyParamCaption}
\item[{const {\bf \-Box} \&}]{}
\end{DoxyParamCaption}
) const}}
\label{class_box_abc15073158a80e02f4b1fb32b50e1eb6}


\-Containing function. 

\-Checks if a box is inside the instance


\begin{DoxyParams}{\-Parameters}
{\em box} & \-: the box \\
\hline
\end{DoxyParams}
\hypertarget{class_box_aa3a80d26840216d02e1096e28333d65b}{
\index{\-Box@{\-Box}!\-Inside@{\-Inside}}
\index{\-Inside@{\-Inside}!Box@{\-Box}}
\subsubsection[{\-Inside}]{\setlength{\rightskip}{0pt plus 5cm}int \-Box\-::\-Inside (
\begin{DoxyParamCaption}
\item[{const {\bf \-Vector} \&}]{}
\end{DoxyParamCaption}
) const}}
\label{class_box_aa3a80d26840216d02e1096e28333d65b}


\-Containing function. 

\-Checks if a point is inside the instance


\begin{DoxyParams}{\-Parameters}
{\em u} & \-: the box \\
\hline
\end{DoxyParams}
\hypertarget{class_box_a6ac204afbbdc851645f33df16104292a}{
\index{\-Box@{\-Box}!\-Intersect@{\-Intersect}}
\index{\-Intersect@{\-Intersect}!Box@{\-Box}}
\subsubsection[{\-Intersect}]{\setlength{\rightskip}{0pt plus 5cm}int \-Box\-::\-Intersect (
\begin{DoxyParamCaption}
\item[{const {\bf \-Ray} \&}]{, }
\item[{{\bf \-Intersection} \&}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_box_a6ac204afbbdc851645f33df16104292a}


\-Intersecting function. 

\-Compute the intersection between a box and a ray


\begin{DoxyParams}{\-Parameters}
{\em ray} & \-: the ray \\
\hline
{\em inter1} & \-: the intersection \\
\hline
\end{DoxyParams}


\-Implements \hyperlink{class_node_ac0836475b7b0275dffe5ce89547f6852}{\-Node}.

\hypertarget{class_box_a53e6a5db3bcc420700f88e6759da805d}{
\index{\-Box@{\-Box}!\-Intersect@{\-Intersect}}
\index{\-Intersect@{\-Intersect}!Box@{\-Box}}
\subsubsection[{\-Intersect}]{\setlength{\rightskip}{0pt plus 5cm}int \-Box\-::\-Intersect (
\begin{DoxyParamCaption}
\item[{const {\bf \-Ray} \&}]{, }
\item[{{\bf \-Intersection} \&}]{, }
\item[{{\bf \-Intersection} \&}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_box_a53e6a5db3bcc420700f88e6759da805d}


\-Intersecting function. 

\-Compute the intersections between a box and a ray


\begin{DoxyParams}{\-Parameters}
{\em ray} & \-: the ray \\
\hline
{\em inter1} & \-: the first intersection \\
\hline
{\em inter2} & \-: the second intersection \\
\hline
\end{DoxyParams}


\-Implements \hyperlink{class_node_a8f308647523fba2603248b83149855a5}{\-Node}.

\hypertarget{class_box_a13633b69e0fa7b8e6ca35c5d0fc65a8a}{
\index{\-Box@{\-Box}!\-Intersect@{\-Intersect}}
\index{\-Intersect@{\-Intersect}!Box@{\-Box}}
\subsubsection[{\-Intersect}]{\setlength{\rightskip}{0pt plus 5cm}int \-Box\-::\-Intersect (
\begin{DoxyParamCaption}
\item[{const {\bf \-Ray} \&}]{, }
\item[{double \&}]{, }
\item[{{\bf \-Vector} \&}]{}
\end{DoxyParamCaption}
) const}}
\label{class_box_a13633b69e0fa7b8e6ca35c5d0fc65a8a}


\-Intersecting function. 

\-Compute the first positive intersection between an axis aligned box and a ray


\begin{DoxyParams}{\-Parameters}
{\em ray} & \-: the ray \\
\hline
{\em t} & \-: the first intersection \\
\hline
{\em n} & \-: the normal at intersection point \\
\hline
\end{DoxyParams}
\hypertarget{class_box_afb71788385a4f8ff91c6d8385972dde4}{
\index{\-Box@{\-Box}!\-P\-M\-C@{\-P\-M\-C}}
\index{\-P\-M\-C@{\-P\-M\-C}!Box@{\-Box}}
\subsubsection[{\-P\-M\-C}]{\setlength{\rightskip}{0pt plus 5cm}int \-Box\-::\-P\-M\-C (
\begin{DoxyParamCaption}
\item[{const {\bf \-Vector} \&}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_box_afb71788385a4f8ff91c6d8385972dde4}


\-Containing function. 

\-Checks if a point is inside the instance


\begin{DoxyParams}{\-Parameters}
{\em u} & \-: the point \\
\hline
\end{DoxyParams}


\-Implements \hyperlink{class_node_aeecdf01a88be40840b65eb34cecc7a3c}{\-Node}.



\subsection{\-Member \-Data \-Documentation}
\hypertarget{class_box_af9c25486a750badb5e746ba616e44bce}{
\index{\-Box@{\-Box}!a@{a}}
\index{a@{a}!Box@{\-Box}}
\subsubsection[{a}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Vector} {\bf \-Box\-::a}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_box_af9c25486a750badb5e746ba616e44bce}
\hyperlink{class_box}{\-Box} bottom left point \hypertarget{class_box_a9ba6812e3bc99ab5faf29f44550b57f5}{
\index{\-Box@{\-Box}!b@{b}}
\index{b@{b}!Box@{\-Box}}
\subsubsection[{b}]{\setlength{\rightskip}{0pt plus 5cm}{\bf \-Vector} {\bf \-Box\-::b}\hspace{0.3cm}{\ttfamily  \mbox{[}protected\mbox{]}}}}
\label{class_box_a9ba6812e3bc99ab5faf29f44550b57f5}
\hyperlink{class_box}{\-Box} upper right point \hypertarget{class_box_ab038c94f04821a9ab0e0313819e5187c}{
\index{\-Box@{\-Box}!epsilon@{epsilon}}
\index{epsilon@{epsilon}!Box@{\-Box}}
\subsubsection[{epsilon}]{\setlength{\rightskip}{0pt plus 5cm}const double {\bf \-Box\-::epsilon}\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_box_ab038c94f04821a9ab0e0313819e5187c}
\-Epsilon value used to check intersections and some round off errors 

\-The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
headers/\hyperlink{box_8h}{box.\-h}\end{DoxyCompactItemize}
